🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

xml-encryption

Package Overview
Dependencies
Maintainers
49
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

xml-encryption

[![Build Status](https://travis-ci.org/auth0/node-xml-encryption.png)](https://travis-ci.org/auth0/node-xml-encryption)

1.3.0
Source
npm
Version published
Weekly downloads
596K
4.46%
Maintainers
49
Weekly downloads
 
Created

What is xml-encryption?

The xml-encryption npm package provides tools for encrypting and decrypting XML data. It supports various encryption algorithms and allows for the secure handling of XML documents.

What are xml-encryption's main functionalities?

Encrypting XML Data

This feature allows you to encrypt XML data using a specified encryption algorithm and keys. The code sample demonstrates how to encrypt an XML string using RSA and AES256-CBC.

const xmlenc = require('xml-encryption');
const xml = '<root><name>John Doe</name></root>';
const options = { rsa_pub: 'public_key.pem', pem: 'private_key.pem', encryptionAlgorithm: 'http://www.w3.org/2001/04/xmlenc#aes256-cbc' };
xmlenc.encrypt(xml, options, function(err, result) {
  if (err) console.error(err);
  console.log('Encrypted XML:', result);
});

Decrypting XML Data

This feature allows you to decrypt previously encrypted XML data using the appropriate private key. The code sample demonstrates how to decrypt an encrypted XML string.

const xmlenc = require('xml-encryption');
const encryptedXml = '...'; // Encrypted XML string
const options = { key: 'private_key.pem' };
xmlenc.decrypt(encryptedXml, options, function(err, result) {
  if (err) console.error(err);
  console.log('Decrypted XML:', result);
});

Other packages similar to xml-encryption

Keywords

xml

FAQs

Package last updated on 25 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts